package com.swim.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.ManyToOne;
import javax.persistence.JoinColumn;

@Entity
@Table(name="CollaborationRequest")
public class CollaborationRequest implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 8842391294255801740L;

	
	@Id
	@GeneratedValue
	@Column(name="id", nullable=false)
	private int id;
	
	@ManyToOne
	@JoinColumn(name="emailFrom")
	private RegisteredUser emailFrom;
	
	@ManyToOne
	@JoinColumn(name="emailTo")
	private RegisteredUser emailTo;
	
	@ManyToOne
	@JoinColumn(name="idSkill")
	private Skill idSkill;
	
	@Column(name="date", nullable=false)
	private String date;
	
	
	
	
	public CollaborationRequest() {}
	
	public CollaborationRequest(RegisteredUser emailFrom, RegisteredUser emailTo, 
			Skill skill, String date){
		setEmailFrom(emailFrom);
		setEmailTo(emailTo);
		setIdSkill(skill);
		setDate(date);
	}

	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}

     /**
	 * @return the date
	 */
	public String getDate() {
		return date;
	}

	/**
	 * @param date the date to set
	 */
	public void setDate(String date) {
		this.date = date;
	}

	/**
	 * @return the email of the applicant
	 */
	public RegisteredUser getEmailFrom() {
		return emailFrom;
	}

	/**
	 * @param emailFrom the email of the applicant to set
	 */
	public void setEmailFrom(RegisteredUser emailFrom) {
		this.emailFrom = emailFrom;
	}

	/**
	 * @return the email of the recipient
	 */
	public RegisteredUser getEmailTo() {
		return emailTo;
	}

	/**
	 * @param emailTo the email of the recipient to set
	 */
	public void setEmailTo(RegisteredUser emailTo) {
		this.emailTo = emailTo;
	}

	/**
	 * @return the id of the Skill
	 */
	public Skill getIdSkill() {
		return idSkill;
	}
	
	/**
	 * @param idSkill the id of the Skill to set
	 */
	public void setIdSkill(Skill idSkill) {
		this.idSkill = idSkill;
	}
	
}
